﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _69重写练习2_飞机大战中的飞机
{
    public class Plane
    {
        /// <summary>
        /// 血量
        /// </summary>
        public int hp;

        /// <summary>
        /// 受伤
        /// </summary>
        /// <param name="value">伤害值</param>
        public virtual void GetHurt(int value)
        {
            Console.WriteLine("受伤:" + value);
            hp -= value;
            if (hp <= 0)
            {
                Die();
            }
        }

        /// <summary>
        /// 死亡
        /// </summary>
        public virtual void Die()
        {
            Console.WriteLine("死亡");
        }
    }
}